Create Data Sources – SQL Server

SQL Server driver is not available by default while configuring a datasource on WebLogic. Follow the below steps:

Registering Driver Class and Description

Add the following code snippet at the mentioned file. This snippet contains a description of Driver Class and the proper use of it inside Oracle WebLogic Driver declaration.

$WL_HOME/server/lib/jdbcdrivers.xml

For Example: /scratch/Oracle/Middleware/Oracle_Home/wlserver/server/lib/jdbcdrivers.xml

 

/scratch/Oracle/Middleware/Oracle_Home/wlserver/server/lib/jdbcdrivers.xml

JDBC Drivers XML
<Driver Database="MS SQL Server" Vendor="Microsoft" Type="Type 4" DatabaseVersion="2005 and later" 
ForXA="false" ClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" 
URLHelperClassname="weblogic.jdbc.utils.MSSQL2005JDBC4DriverURLHelper" 
TestSql="SELECT 1"> <Attribute Name="DbmsName" Required="true" InURL="true"/> 
<Attribute Name="DbmsHost" Required="true" InURL="true"/> 
<Attribute Name="DbmsPort" Required="true" InURL="true" DefaultValue="1433"/> 
<Attribute Name="DbmsUsername" Required="true" InURL="false"/> 
<Attribute Name="DbmsPassword" Required="true" InURL="false"/> 
</Driver>

Create the Data Source for SERVICEDATASOURCE

  1. Select Edit Tree > Services> Data Sources.

  2. Click New.

    1. Name: This name can be anything, but has to be unique for the entire WebLogic server. If you have more than one OIPA instance on the server, then each instance should have a unique name.

    2. JNDI Name : SERVICEDATASOURCE. This name cannot be anything other than SERVICEDATASOURCE.

    3. For Targets select ServiceLayer from Available list and click on > button to add to Chosen list.

    4. Select Generic Data Source for Data Source Type.

    5. Select the MS SQL Server database type.

    6. Select the driver- MS SQL Server Driver (Type 4) Versions:2005 and later Other.

    7. Enter the Database Name.

    8. Enter the Host Name of the database server.

    9. Enter the Port number of the database server.

    10. Enter the Database user name. This can be obtained from the database administrator who installed the databases.

    11. Enter both password entries. This can be obtained from the database administrator who installed the databases.

    12. Select CREATE.

    13. Open created data source and go to Connection Pool tab.

    14. Click on TestConfiguration to test the connection successful or not.

    15. Save and Commit Changes with Cart icon.